package Thread;

public class Demo13 {
    //sleep版
//    有三个线程，线程名称分别为：a，b，c。
//    每个线程打印自己的名称。
//    需要让他们同时启动，并按 c，b，a的顺序打印


    public static void main(String[] args) throws InterruptedException {
        Thread thread1 = new Thread(() -> {
                    try {
                        Thread.sleep(200);
                    }catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                System.out.println("C");
        });

        Thread thread2 = new Thread(() -> {
                    try {
                        Thread.sleep(400);
                    }catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                System.out.println("B");
        });

        Thread thread3 = new Thread(() -> {
                    try {
                        Thread.sleep(600);
                    }catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                System.out.println("A");
        });

        thread1.start();
        thread2.start();
        thread3.start();
        thread1.join();
        thread2.join();
        thread3.join();
    }
}
